package com.appservice.controller;

import com.vidyu.servicelayer.serviceinterface.ControllerServiceWrapper;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * Created by IntelliJ IDEA.
 * Session: eyalsa
 * Date: 06/03/12
 * Time: 16:11
 * Link Users To Agency
 */
//http://localhost:8081/services/vidyu/addSkill/fdfss/fssddf
@Controller
public class SkillController {

    private static final Logger logger = Logger.getLogger(SkillController.class);

    @Autowired
    ControllerServiceWrapper controllerServiceWrapperImpl;

    @RequestMapping(value = "/vidyu/addSkill/{title}/{desc}", method= RequestMethod.GET)
    public
    @ResponseBody
    long addSkill(@PathVariable String title, @PathVariable String desc) throws Exception {
        try {
            return controllerServiceWrapperImpl.addSkill(title, desc);
        } catch (Exception e) {
            logger.fatal(e);
            throw e;
        }
    }
}

